<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>消息发送框</title>
<link rel="stylesheet" type="text/css"
	href="/bootstrap/bootstrap.4.1.0.css">
<script src="/bootstrap/jquery.3.2.1.min.js"></script>
<script src="/bootstrap/popper.12.5.min.js"></script>
<script src="/bootstrap/bootstrap.4.1.0.min.js"></script>
<script src="/layui/layer/layer.js"></script>
<script type="text/javascript">
	$(function(){
		let aid = window.location.href.split("=")[1];
		$("#send").click(function(){
			var content = $("#content").val();
			var data = {
				"aid":aid,
				"content":content
			}
			$.getJSON("/focus/sendmsg",data,function(res){
				if(res.code==1){
					layer.msg("消息发送成功");
					$("#content").val("");
				}else{
					layer.msg("系统维护中，请稍后再试")
				}
			})
		})
		$("#clear").click(function(){
			$("#content").val("");
		})
	})
</script>
</head>
<body>
	<div class="container">
		<div class="input-group mb-3">
			<input type="text" class="form-control" id="content">
			<div class="input-group-append">
				<button class="btn btn-primary" type="button" id="send">发送</button>
				<button class="btn btn-danger" type="button" id="clear">清空</button>
			</div>
		</div>
	</div>
</body>
</html>